package com.example.myapplication;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

public class MainActivity extends AppCompatActivity implements View.OnClickListener{

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        findViewById(R.id.btn_LinearLayout).setOnClickListener(this);
        findViewById(R.id.btn_RelativeLayout).setOnClickListener(this);
        findViewById(R.id.btn_FrameLayout).setOnClickListener(this);
        findViewById(R.id.btn_TableLayout).setOnClickListener(this);
        findViewById(R.id.btn_GridLayout).setOnClickListener(this);

    }

    public void onClick(View v){
        Intent intent=new Intent();
        switch (v.getId()){
            case R.id.btn_LinearLayout:
                intent.setClass(MainActivity.this,Activity_UC1.class);
                startActivity(intent);
                break;
            case R.id.btn_RelativeLayout:
                intent.setClass(MainActivity.this,Activity_UC2.class);
                startActivity(intent);
                break;
            case R.id.btn_FrameLayout:
                intent.setClass(MainActivity.this,Activity_UC3.class);
                startActivity(intent);
                break;
            case R.id.btn_TableLayout:
                intent.setClass(MainActivity.this,Activity_UC4.class);
                startActivity(intent);
                break;
            case R.id.btn_GridLayout:
                intent.setClass(MainActivity.this,Activity_UC5.class);
                startActivity(intent);
                break;
        }
    }


}
